import Toast from '@vant/weapp/toast/toast';

Page({
  data: {},

  logout() {
    wx.showModal({
      title: '提示',
      content: '确定要退出登录吗？',
      success(res) {
        if (res.confirm) {
          wx.clearStorageSync('userInfo'); // 清除本地存储的用户信息
          Toast.success('退出登录成功');
          wx.switchTab({
						url: '/pages/mine/mine',
					})
        }
      }
    });
	},
	onEdit(){
		wx.navigateTo({
			url: '/mine/pages/edit/edit',
		})
	},
	onContactInformation(){
		wx.navigateTo({
			url: '/mine/pages/contact_information/contact_information',
		})
	},
	onPhoneBinding(){
		wx.navigateTo({
			url: '/mine/pages/phone-binding/phone-binding',
		})
	}
});